<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class CourseChapter extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'course_chapters';
    public $timestamps = false;

    protected $fillable = [
        'course_chapter_number_id',
        'course_id',
        'name',
        'video_url',
        'video_poster',
        'is_free'
    ];

    public function course()
    {
        return $this->belongsTo(Course::class,'course_id');
    }

    public function number()
    {
        return $this->belongsTo(CourseChapterNumber::class,'course_chapter_number_id');
    }
}
